import javax.swing.*;
import java.awt.event.*;

public class TestGUI {

	private static void createAndShowGUI() {
	
 		RopeState rs = new RopeState(true);

		//Create and set up the window.
        JFrame frame = new JFrame("Test Swing");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		//Add the animation panel
		AnimationPanel ap = new AnimationPanel(rs);
		frame.getContentPane().add(ap);

        //Display the window.
        frame.pack();
        frame.setVisible(true);

		//Kick the animation starting
		ap.start();

		//Move the rope around... (do it on a new thread)
		(new Thread(new DummyCommunication(rs))).start();
		
	}
	
    public static void main(String[] args) {
	
		SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI(); 
            }
        });
		
    }
}
